﻿
<%@ Page Language="C#" MasterPageFile="~/BasicBase/BasicBase.master" AutoEventWireup="true" CodeFile="SocLinkeAdd.aspx.cs" Inherits="BasicBase_SocLinke_SocLinkeAdd" StylesheetTheme="Content" Title="社会联动信息添加" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<link rel="stylesheet" type="text/css" href="easyUI/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="easyUI/themes/icon.css">
	<script type="text/javascript" src="easyUI/jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="easyUI/jquery.easyui.min.js"></script>
	<script language="javascript">
		$(function(){
			$('#sort01').combobox({
				url:'SocLinke.ashx?act=BigSort&m'+Math.random(),
				valueField:'id',
				width:'200',
				textField:'text'
			});
			$('#dep').combobox({
				url:'SocLinke.ashx?act=dep&dep=<%=GetDepartmentid() %>&m'+Math.random(),
				valueField:'id',
				width:'200',
				textField:'text'
			});
			$('#sort01').combobox({onChange:function(newValue){
				
				if(newValue=='A400')
				{
					$('#InfoNameTxt').html("专家姓名：");
					$('#AddressTxt').html("工作单位：");
				}else
				{
					$('#InfoNameTxt').html("单位名称：");
					$('#AddressTxt').html("单位地址：");
				}
			}});
			$('#dep').combobox("select",'<%=GetDepartmentid() %>');

		});
	var SxTr=0;
	function AddSx(currentRowID)
	{
		$.each( $('#mainTable tr'), function(i, tr){
           if($(this).attr('id')==currentRowID){
               //获取当前行
               var currentRow=$('#mainTable tr:eq('+i+')');
               //要添加的行的id
			   SxTr=SxTr+1;
               var addRowID="SocProp"+SxTr;
               //str = "<tr id = '"+addRowID+"'><td>"+addRowID+"</td><td>row"+addRowID+"</td>"+
               //"<td><input id= '"+addRowID+"' type='button' value='添加行' onclick='addRowByID(this.id);' /></td></tr>";
               //当前行之后插入一行
			   str=" <tr id = '"+addRowID+"'>"+
					"<td height=\"25\" align=\"right\" valign=\"middle\">属性名称：</td>"+
					"<td height=\"25\" align=\"left\" valign=\"middle\"><label>"+
					  "<input type=\"text\" id=\"s"+addRowID+"\" name=\"s"+addRowID+"\"  required=\"true\"/>"+
					"数量："+
					"<input name=\"n"+addRowID+"\" class=\"easyui-numberbox\" id=\"n"+addRowID+"\" type=\"text\" style='width:80px;' precision=\"2\" required=\"true\"/>"+
					"单位："+
					
					"<select name=\"d"+addRowID+"\"  id=\"d"+addRowID+"\" style=\"width:60px;\" required=\"true\">"+
					"</select>"+
				   " </label></td>"+
				  "</tr>";
               currentRow.after(str);
			   $('#n'+addRowID).numberbox({precision:'2'});
			   $('#s'+addRowID).combobox({
				url:'SocLinke.ashx?act=PropName&m'+Math.random(),
				valueField:'id',
				textField:'text'
				});
			     $('#d'+addRowID).combobox({
				url:'SocLinke.ashx?act=PropUnit&m'+Math.random(),
				valueField:'id',
				textField:'text'
				});
           }
       });
	}
	</script>
<table id="mainTable" width="100%" border="0" cellspacing="0" cellpadding="0">
	<caption>
            <span>社会联动信息添加</span>
    </caption>
    <tr>
    <td width="100" height="25" align="right" valign="middle">所属支（大）队：</td>
    <td align="left" valign="middle"><select id="dep"  name="dep" style="width:200px;" >
	
	</select></td>
  </tr>
  <tr>
    <td width="100" height="25" align="right" valign="middle">信息类别：</td>
    <td align="left" valign="middle"><select id="sort01"  name="sort01" style="width:200px;" >
	
	</select></td>
  </tr>
  <tr>
    <td width="100" height="25" align="right" valign="middle" id="InfoNameTxt">单位名称：</td>
    <td align="left" valign="middle"><input name="InfoName" class="easyui-validatebox" type="text" style="width:395px;" required="true" /></td>
  </tr>
  <tr>
    <td height="25" align="right" valign="middle">联系人：</td>
    <td align="left" valign="middle"><input name="LinkPeople" type="text" class="easyui-validatebox" id="LinkPeople" style="width:395px;" required="true" /></td>
  </tr>
  <tr>
    <td width="100" height="25" align="right" valign="middle">联系电话：</td>
    <td align="left" valign="middle"><input name="TelPhone" class="easyui-validatebox" type="text" style="width:395px;" required="true" /></td>
  </tr>
  <tr>
    <td width="100" height="25" align="right" valign="middle">单位传真：</td>
    <td align="left" valign="middle"><input name="Fax" type="text" style="width:395px;" /></td>
  </tr>
  <tr>
    <td width="100" height="25" align="right" valign="middle" id="AddressTxt">单位地址：</td>
    <td align="left" valign="middle"><input name="Address" type="text" style="width:395px;" /></td>
  </tr>
  <tr id="SxAfter">
    <td width="100" height="25" align="right" valign="middle">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</td>
    <td align="left" valign="middle"><input name="mark" type="text" style="width:395px;"  /><input type="button" onclick="AddSx('SxAfter')" name="Button1" value="添加属性" id="Button1" class="button_default" />  </td>
  </tr>
 
  <tr>
    <td width="100" height="25" align="right" valign="middle"></td>
    <td align="left" valign="middle">
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="保存" />    </td>
  </tr>
</table>
</asp:Content>

